//
//  BuyyerListTableViewCell.m
//  SmartCoin
//
//  Created by apple on 2018/3/14.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "BuyyerListTableViewCell.h"

@implementation BuyyerListTableViewCell
/**
 @property (nonatomic ,retain)UILabel *timelabel;
 @property (nonatomic ,retain)UILabel *allmoneylabel;
 @property (nonatomic ,retain)UILabel *allRiselabel;
 @property (nonatomic ,retain)UILabel *myRiselabel;
 */
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    NSArray *titles = @[@"",@"订单实付金额",@"订单总分红",@"我获得分红"];
    for (NSInteger index = 0; index < 4; index ++) {
        UILabel *left = [[UILabel alloc] initWithFrame:CGRectMake(12, 10 + 40 * index, 200, 20)];
        UILabel *right = [[UILabel alloc] initWithFrame:CGRectMake(cx_wid - 200 - 12, 10 + 40 * index, 200, 20)];
        right.textAlignment = NSTextAlignmentRight;
        left.textColor = [CXSinglerModel colorWithHex:@"666666" alpha:1];
        right.textColor = [UIColor blackColor];
        UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(0, 40 * index, cx_wid, 40)];
            bgview.backgroundColor = [UIColor whiteColor];
        if(index != 3){
        UIView *bglayer = [[UIView alloc] initWithFrame:CGRectMake(12, 39, cx_wid - 24, 1)];
        bglayer.backgroundColor = [CXSinglerModel colorWithHex:@"E2E2E2" alpha:1];
        [bgview addSubview:bglayer];
        }
        [self.contentView addSubview:bgview];
//        }
        if (index == 0) {
            _timelabel = left;
            _idlabel = right;
            _idlabel.font = [UIFont systemFontOfSize:10];
        }
        else if (index == 1){
            _allmoneylabel = right;
            left.text = titles[index];
        }
        else if (index == 2){
            _allRiselabel = right;
            left.text = titles[index];
        }
        else if (index == 3){
            _myRiselabel = right;
            left.text = titles[index];
        }
        [self.contentView addSubview:left];
        [self.contentView addSubview:right];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
